package com.htsk.city.services.core.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;

/**
 * @Author 李树洪
 * @Email 2324592742@qq.com
 * @Date 2025/9/8 19:38
 */
@Data
@Entity
@Table(name = "technician_availability")
public class TechnicianAvailability {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @JoinColumn(name = "technician_id", nullable = false)
    private Long technicianId;

    @Column(name = "start_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date startTime;

    @Column(name = "end_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date endTime;

    @Column(name = "availability_type", length = 20)
    private String availabilityType;

    @Column(name = "is_available")
    private Integer isAvailable;

    @CreationTimestamp
    @Column(name = "created_at")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date createdAt;

    @UpdateTimestamp
    @Column(name = "updated_at")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date updatedAt;

}
